package jnpf.engine.fallback;

import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.engine.FlowTaskApi;
import jnpf.engine.entity.*;
import jnpf.engine.model.flowengine.FlowModel;
import jnpf.engine.model.flowengine.FlowPagination;
import jnpf.engine.model.flowtask.PaginationFlowTask;
import jnpf.engine.model.flowtemplate.FlowTemplateCrForm;
import jnpf.engine.model.flowtemplate.FlowTemplateInfoVO;
import jnpf.model.FlowWorkListVO;
import jnpf.permission.model.user.WorkHandoverModel;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * api接口
 *
 * @author JNPF开发平台组
 * @version V3.1.0
 * @copyright 引迈信息技术有限公司（https://www.jnpfsoft.com）
 * @date 2021/3/15 11:55
 */
@Component
public class FlowTaskApiFallback implements FlowTaskApi {


    @Override
    public PageListVO getWaitList(PaginationFlowTask pagination) {
        PaginationVO paginationVO = new PaginationVO();
        paginationVO.setTotal(0);
        PageListVO listVO = new PageListVO();
        listVO.setPagination(paginationVO);
        listVO.setList(new ArrayList<>());
        return listVO;
    }

    @Override
    public PageListVO getTrialList(PaginationFlowTask pagination) {
        PaginationVO paginationVO = new PaginationVO();
        paginationVO.setTotal(0);
        PageListVO listVO = new PageListVO();
        listVO.setPagination(paginationVO);
        listVO.setList(new ArrayList<>());
        return listVO;
    }

    @Override
    public List<FlowTaskEntity> getOrderStaList(List<String> idAll) {
        return new ArrayList<>();
    }

    @Override
    public List<FlowTaskEntity> getTaskList(String[] ids) {
        return new ArrayList<>();
    }

    @Override
    public List<FlowDelegateEntity> getDelegateList() {
        return new ArrayList<>();
    }

    @Override
    public PageListVO getCirculateList(PaginationFlowTask pagination) {
        PaginationVO paginationVO = new PaginationVO();
        paginationVO.setTotal(0);
        PageListVO listVO = new PageListVO();
        listVO.setPagination(paginationVO);
        listVO.setList(new ArrayList<>());
        return listVO;
    }

    @Override
    public PageListVO getListAll(FlowPagination pagination) {
        PaginationVO paginationVO = new PaginationVO();
        paginationVO.setTotal(0);
        PageListVO listVO = new PageListVO();
        listVO.setPagination(paginationVO);
        listVO.setList(new ArrayList<>());
        return listVO;
    }

    @Override
    public List<FlowTemplateEntity> getTemplateList(List<String> templaIdList) {
        return new ArrayList<>();
    }

    @Override
    public FlowTemplateJsonEntity getFlowTemplateJsonEntity(String id) {
        return new FlowTemplateJsonEntity();
    }

    @Override
    public ActionResult<FlowTaskEntity> getInfoSubmit(String id) {
        return ActionResult.fail("获取失败");
    }

    @Override
    public ActionResult deleteFlowTask(FlowTaskEntity taskEntity) {
        return ActionResult.fail("删除失败！");
    }

    @Override
    public ActionResult createTemplate(FlowTemplateCrForm templateCrForm) {
        return ActionResult.fail("新增失败");
    }

    @Override
    public ActionResult updateTemplate(String id, FlowTemplateCrForm templateCrForm) {
        return ActionResult.fail("修改失败");
    }

    @Override
    public FlowTemplateInfoVO getTemplateInfo(String id) {
        return null;
    }

    @Override
    public ActionResult deleteTemplateInfo(String id) {
        return ActionResult.fail("删除失败");
    }

    @Override
    public void saveLogicFlowAndForm(String id) {

    }

    @Override
    public FlowWorkListVO flowWork(String fromId) {
        return null;
    }

    @Override
    public boolean saveFlowWork(WorkHandoverModel workHandoverModel) {
        return false;
    }

    @Override
    public ActionResult batchCreateOrUpdate(FlowModel flowModel)  {
        return ActionResult.fail("");
    }

    @Override
    public ActionResult List2(PaginationFlowTask paginationFlowTask) {
        return null;
    }

}
